package com.itheima.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/")
public class UserController {
    /*@RequestMapping("/restful")
    public String restful(){
        System.out.println("restful is running...");
        return "success.jsp";
    }*/
    @RequestMapping("{id}")

    public String restful(@PathVariable Integer id){
        System.out.println("restful is running...");
        return "success.jsp";
    }
    //@RequestMapping(value = "{id}",method = RequestMethod.POST )
   @PostMapping("{id}")
    public String post(@PathVariable Integer id){
        System.out.println("post is running...");
        return "success.jsp";
    }
    //@RequestMapping(value = "{id}",method = RequestMethod.GET)
    @GetMapping("{id}")
    //@GetMapping("{id}")
    public String get(@PathVariable Integer id){
        System.out.println("get is running...");
        return "success.jsp";
    }
    //@RequestMapping(value = "{id}",method = RequestMethod.DELETE)
    @DeleteMapping("{id}")
    public String delete(@PathVariable Integer id){
        System.out.println("delete is running...");
        return "success.jsp";
    }
    //@RequestMapping(value = "{id}",method = RequestMethod.PUT)
    @PutMapping("{id}")
    public String put(@PathVariable Integer id){
        System.out.println("put is running...");
        return "success.jsp";
    }
}
